#ifndef OLED_H
#define OLED_H

#include "stm32f1xx_hal.h"  // 根据你的MCU型号选择正确的头文件

// 函数声明
void OLED_Init(I2C_HandleTypeDef *hi2c);
void OLED_WriteCommand(I2C_HandleTypeDef *hi2c, uint8_t cmd);
void OLED_WriteData(I2C_HandleTypeDef *hi2c, uint8_t data);
void OLED_SetCursor(I2C_HandleTypeDef *hi2c, uint8_t x, uint8_t y);
void OLED_Clear(I2C_HandleTypeDef *hi2c);
void OLED_DisplayChar(I2C_HandleTypeDef *hi2c, uint8_t x, uint8_t y, char ch);
void OLED_DisplayChinese(I2C_HandleTypeDef *hi2c, uint8_t x, uint8_t y, uint8_t index);
void OLED_DisplayString(I2C_HandleTypeDef *hi2c, uint8_t x, uint8_t y, char *str);
void OLED_DisplayStringCentered(I2C_HandleTypeDef *hi2c, uint8_t line, char *str);
uint8_t GetChineseIndex(char *str);

#endif